-- dark_dragon
-- created by panyl
-- 地牢格子：物品（可拾取类）

return {
    restoreGrid = function(grid, info)
         grid.submit = info["submit"];
    end,

    -- 收集上下文
    collectContext = function(grid)
        return {["submit"] = grid.submit, };
    end,

    -- 自动战斗
    autoFight = function(grid)
        local pos = grid:getPos();
        local classId1 = 8148;
        local classId2 = 8109;

        if ItemM.getAmount(ME.user, classId1) <= 0 or
            ItemM.getAmount(ME.user, classId2) <= 0 then
            return false;
        end

        -- 尝试提交正确的物品
        return DungeonActionM.go("dark_dragon_submit", pos, 
            bit.blshift(classId1, 16) + classId2);
    end,
};
